Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled GitHub Actions to Run Tests on Pull Request #392

Merged
merged 5 commits into from
Nov 21, 2020

Conversation

NightOwl888
Copy link
Contributor

Added a Powershell script named Generate-TestWorkflows.ps1 that generates a workflow for each test project. Paths are built based on ProjectReference elements in the .csproj files (recursively) so that a change doesn't run any tests that don't have a dependency on the project that has the change. Common project files always run all of the tests. Markdown files are always ignored.

To keep the workload to a minimum, tests are only performed on Windows and Linux and only on .NET 5, .NET Core 2.1, and .NET Framework 4.8 all in x64 in Release mode. This should catch nearly every issue a contributor is likely to encounter. We will run a more thorough check in the CI and Nightly builds.

Reporting is a bit of an issue. We enabled the console logger so the test results are written to the console, which is the best view. For details, each job has artifacts that can be downloaded that contain a Markdown report and a TRX file.

Test Failures

The few tests that are known to occasionally fail have been marked with the AwaitsFixAttribute. This takes them out of the "normal" flow so they do not execute by default when working in Visual Studio or when submitting a PR.

The default has been changed to run them when using Azure DevOps during CI, Nightly, and Release builds so we don't lose visibility of them.

This change allows us to use a zero tolerance rule when getting contributions - that is, we don't merge anything that causes one or more tests to fail.

Future Improvements

There is a clever way to add a markdown file as a comment to a PR, but there doesn't seem to be a way to fire an event after multiple workflows have finished running, and doing so for each workflow would cause a lot of unnecessary noise on the PR.

There is also a feature request for using paths per job which might help us down the road, which would mean the script would need to be changed to generate a single file with all of the jobs in it. This would at least allow us to put all of the artifacts in one place, but the lack of anything like an Azure DevOps stage is still preventing us from being able to summarize all of the test reports into a single comment on the PR.

@NightOwl888 NightOwl888 merged commit b5e1958 into apache:master Nov 21, 2020
@NightOwl888 NightOwl888 modified the milestone: 4.8.0-beta00014 Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant